<?php

/*

Daily Lotteries (daily.php)

*/

$rank_check = 1;
$page_title = "Daily Lottery";
include "header.inc.php";

if ($play == 3)
{
	$query = mysql_query("SELECT * FROM daily_three2 WHERE game = '$game'");
	$tickets_sold = mysql_num_rows($query);
	$jackpot = $tickets_sold * 65;
	echo $openHTML;
	echo "<p align=center><b>Buy your daily three ticket today!</b></p><p>The jackpot has already reached $jackpot $pointsVar. With tickets only costing 100 $pointsVar you would be stupid NOT TO buy one. So pick your numbers and buy your ticket. Or if you're lazy, buy a random ticket by clicking <a href=$base_url/buylottoticket.pro.php?game=$game&daily=3&rand=true>here</a>.</p><p align=center><form action=$base_url/buylottoticket.pro.php?game=$game method=post><input type=hidden name=daily value=3><select name=first><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><select name=second><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><select name=third><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><input type=submit name=submit value='Buy it!'></form></p><p align=center><a href=$base_url/buylottoticket.pro.php?game=$game&daily=3&rand=true><font size=+2>Buy a Random Ticket!</font></a></p>";

	print "<table cellspacing=0 cellpadding=0>
	<tr height=18>
	<td width=20><p>&nbsp;</p></td>
	<td width=80><p align=center>First #</p></td>
	<td width=80><p align=center>Second #</p></td>
	<td width=80><p align=center>Third #</p></td>
	</tr>";

	$x = 0;
	$findTickets = mysql_query("SELECT * FROM daily_three2 WHERE user = '$userid'");
	while ($getTickets = mysql_fetch_array($findTickets))
	{
		$x++;
		print "
		<tr height=18>
		<td><p><B>$x</b></p></td>
		<td><p align=center>$getTickets[first]</p></td>
		<td><p align=center>$getTickets[second]</p></td>
		<td><p align=center>$getTickets[third]</p></td>
		</tr>";
	}

	print "</table>";

	echo $closeHTML;
}

if ($play == 4)
{
	$query = mysql_query("SELECT * FROM daily_four2 WHERE game = '$game'");
	$tickets_sold = mysql_num_rows($query);
	$jackpot = $tickets_sold * 65;
	echo $openHTML;
	echo "<p align=center><b>Buy your daily four ticket today!</b></p><p>The jackpot has already reached $jackpot $pointsVar. With tickets only costing 100 $pointsVar you would be stupid NOT TO buy one. So pick your numbers and buy your ticket. Or if you're lazy, buy a random ticket by clicking <a href=$base_url/buylottoticket.pro.php?game=$game&daily=4&rand=true>here</a>.</p><p align=center><form action=$base_url/buylottoticket.pro.php?game=$game method=post><input type=hidden name=daily value=4>
<select name=first><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select>
<select name=second><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select>
<select name=third><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select>
<select name=fourth><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select>
<input type=submit name=submit value='Buy it!'></form></p><p align=center><a href=$base_url/buylottoticket.pro.php?game=$game&daily=4&rand=true><font size=+2>Buy a Random Ticket!</font></a></p>";

	print "<table cellspacing=0 cellpadding=0>
	<tr height=18>
	<td width=20><p>&nbsp;</p></td>
	<td width=80><p align=center>First #</p></td>
	<td width=80><p align=center>Second #</p></td>
	<td width=80><p align=center>Third #</p></td>
	<td width=80><p align=center>Fourth #</p></td>
	</tr>";

	$x = 0;
	$findTickets = mysql_query("SELECT * FROM daily_four2 WHERE user = '$userid'");
	while ($getTickets = mysql_fetch_array($findTickets))
	{
		$x++;
		print "
		<tr height=18>
		<td><p><B>$x</b></p></td>
		<td><p align=center>$getTickets[first]</p></td>
		<td><p align=center>$getTickets[second]</p></td>
		<td><p align=center>$getTickets[third]</p></td>
		<td><p align=center>$getTickets[fourth]</p></td>
		</tr>";
	}

	print "</table>";

	echo $closeHTML;
}

if ($play == 5)
{
	$query = mysql_query("SELECT * FROM daily_five2 WHERE game = '$game'");
	$tickets_sold = mysql_num_rows($query);
	$jackpot = $tickets_sold * 99;
	echo $openHTML;
	echo "<p align=center><b>Buy your daily five ticket today!</b></p><p>The jackpot has already reached $jackpot $pointsVar. With tickets only costing 100 $pointsVar you would be stupid NOT TO buy one. So pick your numbers and buy your ticket. Or if you're lazy, buy a random ticket by clicking <a href=$base_url/buylottoticket.pro.php?game=$game&daily=5&rand=true method=post>here</a>.</p><p align=center><form action=$base_url/buylottoticket.pro.php?game=$game><input type=hidden name=daily value=5><select name=first><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><select name=second><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><select name=third><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><select name=fourth><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><select name=fifth><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9</select><input type=submit name=submit value='Buy it!'></form></p><p align=center><a href=$base_url/buylottoticket.pro.php?game=$game&daily=5&rand=true><font size=+2>Buy a Random Ticket!</font></a></p>";

	print "<table cellspacing=0 cellpadding=0>
	<tr height=18>
	<td width=20><p>&nbsp;</p></td>
	<td width=80><p align=center>First #</p></td>
	<td width=80><p align=center>Second #</p></td>
	<td width=80><p align=center>Third #</p></td>
	<td width=80><p align=center>Fourth #</p></td>
	<td width=80><p align=center>Fifth #</p></td>
	</tr>";

	$x = 0;
	$findTickets = mysql_query("SELECT * FROM daily_five2 WHERE user = '$userid'");
	while ($getTickets = mysql_fetch_array($findTickets))
	{
		$x++;
		print "
		<tr height=18>
		<td><p><B>$x</b></p></td>
		<td><p align=center>$getTickets[first]</p></td>
		<td><p align=center>$getTickets[second]</p></td>
		<td><p align=center>$getTickets[third]</p></td>
		<td><p align=center>$getTickets[fourth]</p></td>
		<td><p align=center>$getTickets[fifth]</p></td>
		</tr>";
	}

	print "</table>";

	echo $closeHTML;
}

?>